﻿namespace LinkedTU.Data.Interfaces
{
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;
    using LinkedTU.Models;

    public interface ILinkedTuDbContext<TUser, TRole>
        where TUser : Microsoft.AspNet.Identity.EntityFramework.IdentityUser
        where TRole : Microsoft.AspNet.Identity.EntityFramework.IdentityRole
    {
        /// <summary>
        /// Gets or Sets IDbSet of Roles
        /// </summary>
        IDbSet<TRole> Roles { get; set; }

        /// <summary>
        /// Gets or Sets IDbSet of Users
        /// </summary>
        IDbSet<TUser> Users { get; set; }

        /// <summary>
        /// Gets or sets the cities.
        /// </summary>
        /// <value>
        /// The cities.
        /// </value>
        IDbSet<City> Cities { get; set; }

        /// <summary>
        /// Gets or sets the countries.
        /// </summary>
        /// <value>
        /// The countries.
        /// </value>
        IDbSet<Country> Countries { get; set; }

        /// <summary>
        /// Gets or sets the job positions.
        /// </summary>
        /// <value>
        /// The job positions.
        /// </value>
        IDbSet<JobPosition> JobPositions { get; set; }

        /// <summary>
        /// Gets or sets the languages.
        /// </summary>
        /// <value>
        /// The languages.
        /// </value>
        IDbSet<Language> Languages { get; set; }

        /// <summary>
        /// Gets or sets the certificates.
        /// </summary>
        /// <value>
        /// The certificates.
        /// </value>
        IDbSet<Certificate> Certificates { get; set; }

        /// <summary>
        /// Gets or sets the comments.
        /// </summary>
        /// <value>
        /// The comments.
        /// </value>
        IDbSet<Comment> Comments { get; set; }

        /// <summary>
        /// Gets or sets the companies.
        /// </summary>
        /// <value>
        /// The companies.
        /// </value>
        IDbSet<Company> Companies { get; set; }

        /// <summary>
        /// Gets or sets the courses.
        /// </summary>
        /// <value>
        /// The courses.
        /// </value>
        IDbSet<Course> Courses { get; set; }

        /// <summary>
        /// Gets or sets the endorsements.
        /// </summary>
        /// <value>
        /// The endorsements.
        /// </value>
        IDbSet<Endorsement> Endorsements { get; set; }

        /// <summary>
        /// Gets or sets the groups.
        /// </summary>
        /// <value>
        /// The groups.
        /// </value>
        IDbSet<Group> Groups { get; set; }

        /// <summary>
        /// Gets or sets the groups memberships.
        /// </summary>
        /// <value>
        /// The groups memberships.
        /// </value>
        IDbSet<GroupMembership> GroupsMemberships { get; set; }

        /// <summary>
        /// Gets or sets the group posts.
        /// </summary>
        /// <value>
        /// The group posts.
        /// </value>
        IDbSet<GroupPost> GroupPosts { get; set; }

        /// <summary>
        /// Gets or sets the jobs.
        /// </summary>
        /// <value>
        /// The jobs.
        /// </value>
        IDbSet<Job> Jobs { get; set; }

        /// <summary>
        /// Gets or sets the profiles infos.
        /// </summary>
        /// <value>
        /// The profiles infos.
        /// </value>
        IDbSet<ProfileInfo> ProfilesInfos { get; set; }

        /// <summary>
        /// Gets or sets the projects.
        /// </summary>
        /// <value>
        /// The projects.
        /// </value>
        IDbSet<Project> Projects { get; set; }

        /// <summary>
        /// Gets or sets the recommendations.
        /// </summary>
        /// <value>
        /// The recommendations.
        /// </value>
        IDbSet<Recommendation> Recommendations { get; set; }

        /// <summary>
        /// Gets or sets the taken courses.
        /// </summary>
        /// <value>
        /// The taken courses.
        /// </value>
        IDbSet<TakenCourse> TakenCourses { get; set; }

        /// <summary>
        /// Gets or sets the users skills.
        /// </summary>
        /// <value>
        /// The users skills.
        /// </value>
        IDbSet<UserSkill> UsersSkills { get; set; }

        /// <summary>
        /// Returns a System.Data.Entity.DbSet<TEntity> instance for access to entities
        /// of the given type in the context and the underlying store.
        /// </summary>
        /// <typeparam name="TEntity">The type entity for which a set should be returned.</typeparam>
        /// <returns>A set for the given entity type.</returns>
        /// <remarks>
        /// Note that Entity Framework requires that this method return the same instance
        /// each time that it is called for a given context instance and entity type.
        /// Also, the non-generic System.Data.Entity.DbSet returned by the System.Data.Entity.DbContext.Set(System.Type)
        /// method must wrap the same underlying query and set of entities. These invariants
        /// must be maintained if this method is overridden for anything other than creating
        /// test doubles for unit testing.  See the System.Data.Entity.DbSet<TEntity>
        /// class for more details.
        /// </remarks>
        IDbSet<TEntity> Set<TEntity>() where TEntity : class;

        /// <summary>
        /// Gets a System.Data.Entity.Infrastructure.DbEntityEntry<TEntity> object for
        /// the given entity providing access to information about the entity and the
        /// ability to perform actions on the entity.
        /// </summary>
        /// <typeparam name="TEntity">The type of the entity</typeparam>
        /// <param name="entity">The entity.</param>
        /// <returns>An entry for the entity.</returns>
        DbEntityEntry<TEntity> Entry<TEntity>(TEntity entity) where TEntity : class;

        /// <summary>
        /// Saves the changes.
        /// </summary>
        int SaveChanges();
    }

}
